/**
@file wall.h
@brief Wall class definition

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 3 of the License.

@author VestniK (Sergey N.Vidyuk) sir.vestnik@gmail.com
@date 10 Oct 2008
 */
#ifndef _Wall_H_
#define _Wall_H_

#include <QtCore/QList>

#include "tile.h"
#include "tileset.h"
#include "baseexception.h"

namespace mjn {

   /**
   @brief MahJong wall.
   */
   class Wall {
      public:
         /// Constructor
         Wall();
         /// Destructor
         virtual ~Wall();

         /// Prepare wall for new round
         void buildWall(const TileSet& tileset);
         /// Take tile from wall
         TileID takeTile() throw(WallEmptyException);
         /// Take tile from dead end
         TileID takeFromDeadEnd() throw(DeadEndEmptyException);

         /// Returns number of tiles on wall
         unsigned getWallSize() const {return WallTiles.size();};
         /// Returns number of tiles in dead end
         unsigned getDeadEndSize() const {return DeadEndTiles.size();};

         /// Checks for ability to take tile.
         bool isOver() const;
      private:
         QList< TileID > WallTiles;
         QList< TileID > DeadEndTiles;
			
   }; // class Wall

} // namespace mjn

#endif
